﻿<!DOCTYPE html>
<html>

<head>
    <meta charset="utf-8" />
    <title></title>
    <script src="https://cdnjs.cloudflare.com/ajax/libs/axios/0.19.2/axios.min.js"></script>
</head>

<body>
    <h1>Test JWT</h1>

    token: <input type="text" id="txt_token" />
    <button onclick="btn_get()">jwt get</button>
    <hr />
    <div id="result">

    </div>
    <script>
        function btn_get() {

            var token = document.querySelector("#txt_token").value;

            axios.get('http://localhost:5730/Home/Get', { headers: { "Authorization": "Bearer " + token } })
                .then(function (response) {
                    document.querySelector("#result").textContent = JSON.stringify(response.data);
                })
                .catch(function (error) {
                    console.log(error);
                });

        }

    </script>
</body>

</html>